package com.cntcdt.api.db.dao;

import java.util.List;

import com.cntcdt.api.db.dao.base.LockUpChongdianbaoHistoryDaoBase;
import com.cntcdt.api.db.model.LockUpChongdianbaoHistoryModel;

/**
 * 这是cdt_lock_up_chongdianbao_history的Dao实现类
 */
public class LockUpChongdianbaoHistoryDao extends LockUpChongdianbaoHistoryDaoBase   {
    /**
     * LockUpChongdianbaoHistoryDao对象
     */
    private static LockUpChongdianbaoHistoryDao instance = new LockUpChongdianbaoHistoryDao();

    /**
     * 默认构造方法
     */
    private LockUpChongdianbaoHistoryDao() {
    }

    /**
     * 获得对象实例
     */
    public static LockUpChongdianbaoHistoryDao getInstance() { 
         return instance;
    } 
    
    /**
     * 按主键查询model
     * @param id id
     * @return model
     */
    public LockUpChongdianbaoHistoryModel findByLastLockUp(String cdb) {
        String sql = "SELECT * FROM " + TABLE + " WHERE cdb = ? order by addTime desc";
       Object[] paramObjs = {cdb};
       List<LockUpChongdianbaoHistoryModel > modelList = this.queryModelList(sql, paramObjs);
       if(modelList != null && modelList.size() > 0){ 
             return  modelList.get(0);
       } 
       return null;
   }

}
